package business;

import java.util.ArrayList;
import java.util.Map;

import model.Draft;
import model.beans.AcademiaBean;
import model.beans.MinutaBean;
import model.beans.UsuarioBean;

public class Minuta {
	
	
	/**
	 * 
	 * @param user_log
	 * @return
	 */
	public static ArrayList list(UsuarioBean user_log){
		
		AcademiaBean bn_academia = user_log.getAcademia();
		String str_academia  = bn_academia.getCodigo();
		ArrayList arrL_list = Draft.list(str_academia);
		
		return arrL_list;
	}
	
	
	/**
	 * 
	 * @param mapa_add
	 * @param str_idAcademia
	 * @return
	 */
	public static int add(Map mapa_add, String str_idAcademia){
		int int_add = Draft.add(mapa_add, str_idAcademia); 
		return int_add;
	}
	
	/**
	 * 
	 * @param str_min
	 * @return
	 * @throws Exception
	 */
	public static MinutaBean edit(String str_min) throws Exception{
		int int_min = str_min!=null?Integer.parseInt(str_min):0;
		return model.Draft.edit(int_min);
    	
	}
	
	
	/**
	 * 
	 * @param map_delete
	 * @return
	 */
	public static int delete(Map map_delete){
		int int_delete = Draft.delete(map_delete);
		return int_delete;
	}
	
	
	/**
	 * 
	 * @param map_save
	 * @return
	 */
	public static int save(Map map_save){
		int int_save = model.Draft.save(map_save);
		return int_save;
	}
	
	/**
	 * 
	 * @param map_save
	 * @return
	 */
	public static int observation_save(Map map_save, int minuta_id){
		int int_save = model.Draft.observationSave(map_save, minuta_id);
		return int_save;
	}
}
